<%@ page language="java" pageEncoding="UTF-8"%>
<!doctype html>
<html lang="zh-CN">
<head>
<%@include file="/WEB-INF/views/commons/common.jsp"%>
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/bootstrap-dialog3/css/bootstrap-dialog.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/validation-engine/validationEngine.jquery.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/jquery-easyui/1.4.3/themes/metro/easyui.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/font-awesome/4.3.0/css/font-awesome.min.css">

<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/webuploader/0.1.5/webuploader.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/viewer/viewer.css">

<link rel="stylesheet" type="text/css" href="${base_href}/static/css/search-theme.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/css/form-theme.css">

<title>题目详细信息</title>
</head>
<body data-spy="scroll" data-target="#myScrollspy" data-offset="350">


	<div class="main-wrap">

		<!-- 表单 start-->
		<div class="container-fluid">
			<form id="form">
			
				<input type="hidden" name="quesId" value="${form.quesId }" />
				<input type="hidden" name="replyId" value="${form.replyId }" />
				
				<div class="container form-body-div">
					<div class="row text-center title-body" id="baseinfo">
						问题详细信息<br />
					</div>
					<div class="row pannel-title">
						<span>基本信息</span> <a href="javascript:void(0);" class="hide-next-btn">收起</a>
					</div>
					<div class="row pannel-body">
						<table class="form-table">
							<tr>
								<th class="col-xs-2 " rowspan="6">问题</th>
								<th class="col-xs-2 ">问题来源</th>
								<td class="col-xs-2">
									<c:forEach items="${questionSources}" var="dic">
										<c:if test="${dic.code eq form.questionSource}">${dic.value}</c:if>
									</c:forEach> 
								</td>
								<th class="col-xs-2 ">是否追问</th>
								<td class="col-xs-4" >
									<c:if test="${'0' eq form.quesClosely}">否</c:if>
									<c:if test="${'1' eq form.quesClosely}">是</c:if>
								</td>
							</tr>
							<tr>
								<th class="col-xs-2 ">考试类别</th>
								<td class="col-xs-2">
									<c:forEach items="${quesBookClasses}" var="dic">
										<c:if test="${dic.code eq form.bookClass}">${dic.value}</c:if>
									</c:forEach> 
								</td>
								<th class="col-xs-2 ">图书名称</th>
								<td class="col-xs-6">
									<c:if test="${form.bookClass eq '1'}">
										<c:forEach items="${quesBookClasses1}" var="dic">
											<c:if test="${dic.code eq form.bookSecClass}">${dic.value}</c:if>
										</c:forEach> 
									</c:if>
									<c:if test="${form.bookClass eq '2'}">
										<c:forEach items="${quesBookClasses2}" var="dic">
											<c:if test="${dic.code eq form.bookSecClass}">${dic.value}</c:if>
										</c:forEach> 
									</c:if>
									<c:if test="${form.bookClass eq '3'}">
										<c:forEach items="${quesBookClasses3}" var="dic">
											<c:if test="${dic.code eq form.bookSecClass}">${dic.value}</c:if>
										</c:forEach> 
									</c:if>
									<c:if test="${form.bookClass eq '4'}">
										<c:forEach items="${quesBookClasses4}" var="dic">
											<c:if test="${dic.code eq form.bookSecClass}">${dic.value}</c:if>
										</c:forEach> 
									</c:if>
								</td>
							</tr>
							<tr>
								<th class="col-xs-2 ">图书页码</th>
								<td class="col-xs-4">
									${form.pageNum}
								</td>
								<th class="col-xs-2 ">用户等级</th>
								<td class="col-xs-4">
									<c:forEach items="${userTypes}" var="dic">
										<c:if test="${dic.code eq form.userType}">${dic.value}</c:if>
									</c:forEach> 
								</td>
							</tr>
							<tr>
								<th class="col-xs-2 ">问题详情</th>
								<td class="col-xs-10" colspan="3">
									<div class="pre-div">${form.quesDescribe}</div>
								</td>
							</tr>
							<tr>
								<th class="col-xs-2 ">问题图片</th>
								<td class="col-xs-10" colspan="3">
									<table data-ms-class="attachment"
										class="attach-no-table upload-download-element" data-show-upload-button=false
										data-title="上传附件" data-is-readonly=true data-box-id="${form.quesId }"
										>
									</table>
								</td>
							</tr>
							<tr>
								<td colspan="4">
									<span style="float:right">
									<fmt:formatDate value="${form.quesTime}" type="both" pattern="yyyy-MM-dd HH:mm" />
									</span>
								</td>
							</tr>
							<tr>
								<th class="col-xs-2 ">问题难度</th>
								<td colspan="4">
									<c:forEach items="${quesDiffLevels}" var="state">
										<c:if test="${state.code eq form.quesDiffLevel}">${state.value}</c:if>
									</c:forEach> 
								</td>
							</tr>
							
							<tr>
								<th class="col-xs-2 " rowspan="3">回复</th>
								<td class="col-xs-10" colspan="4">
									<button type="button" class="btn search-btn" id="search"><i class="fa fa-search"></i>&nbsp;检索&nbsp;</button>
									<textarea class="form-control validate[maxSize[1000]]" 
										data-errormessage-range-overflow="回复内容不能超过1000个字" rows="10" 
										name="myAnwser" >${form.myAnwser}</textarea>
								</td>
							</tr>
							
							<tr>
								<td class="text-right col-xs-10" colspan="4">
									<button type="button" class="btn btn-sm tool-btn attach-upload">上传图片</button>
									<table data-ms-class="attachment"
										class="attach-no-table upload-download-element" data-show-upload-button=false
										data-title="上传附件" data-is-readonly=false data-box-id="${form.replyId }"
										>
									</table>
								</td>
							</tr>
							
							<tr>
								<td class="text-right col-xs-10" colspan="4">
									<button type="button" class="btn search-btn" id="clear"><i class="fa fa-trash"></i>&nbsp;清空&nbsp;</button>
									<button type="button" class="btn search-btn" id="save"><i class="fa fa-save"></i>&nbsp;保存草稿&nbsp;</button>
									<button type="button" class="btn search-btn" id="reply"><i class="fa fa-reply"></i>&nbsp;确认回复&nbsp;</button>
								</td>
							</tr>
						</table>
					</div>
				</div>
			</form>
		</div>
		<!-- 表单 end-->
		
	</div>
	<script type="text/javascript" src="${base_href}/static/ui-frame/jquery/1.11.3/jquery.js"></script>
	<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap/3.3.5/js/bootstrap.js"></script>
	<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap-dialog3/js/bootstrap-dialog.js"></script>
	<script type="text/javascript" src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine-zh_CN.js"></script>
	<script type="text/javascript" src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine.js"></script>
	<script type="text/javascript" src="${base_href}/static/ui-frame/My97DatePicker/WdatePicker.js"></script>
	
	<script type="text/javascript" src="${base_href}/static/ui-frame/jquery-easyui/1.4.3/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${base_href}/static/ui-frame/jquery-easyui/1.4.3/easyui.util.js"></script>
	
	<script type="text/javascript" src="${base_href}/static/ui-frame/webuploader/0.1.5/mbs-upload.js"></script>
	<script type="text/javascript" src="${base_href}/static/ui-frame/viewer/viewer.js"></script>
	
	
	<script>
	$(function() {
		$("#clear").click(function(){
			$("textarea[name='myAnwser']").val('');
		});
		$("#reply").click(function(){
			return $.post(basePath+ "/myQuesList/reply.json",$("#form").serialize(), function(){
				window.close();
			},'json')
			.error(function(e){
				BootstrapDialog.alert(e.responseJSON.exception.message);
			});
		});
		
		$("#save").click(function(){
			return $.post(basePath+ "/myQuesList/saveQuestion.json",$("#form").serialize(), function(){
				BootstrapDialog.alert("保存成功！")
			},'json');
		});
		
		$(".attach-upload").click(function(){
			$(this).next().uploaddownload();
		})
		
		$(document).on('click', 'img', function(){
			$(this).viewer();
		});
		
		$("#search").click(function(){
			url = basePath + "/teacherController/quesListPage.html";
			var left=Math.round((window.screen.width)/2);  
			var screenLocation = "width=960px,height=960,left="+left+",right=0,menubar=yes,resizable=yes,scrollbars =yes";
			window.open(url,"_blank",screenLocation,"查询列表");
		});
	});
	</script>
</body>
</html>
